package com.cmschina.controller;

import com.alibaba.fastjson.JSONObject;
import com.cmschina.pojo.Event;
import com.cmschina.service.EventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: li chao
 * @Desc:
 * @create: 2024-08-06 13:47
 **/
@RestController
public class EventController {

    @Autowired
    EventService eventService;

    @GetMapping("/event")
    public String getUserInfo() {
        List<Event> events = eventService.findAll();
        return JSONObject.toJSONString(events);
    }
}
